<?php
include 'Models.php';

DbConnector::Connect();

$id = WebHelper::GetInt("id");

$place = new Place($id);

echo("SESSION =" . $_SESSION["MEMBER_ID"]);
echo("RATE = " . $place->GetRate());
echo("LOGGED = " . Member::Logged());
?>

<html>
    <head>
        <script type="text/javascript" src="_script/jquery.js"></script>
        <script type="text/javascript" src="_script/rating.js"></script>
        <link rel="stylesheet" type="text/css" href="_theme/rating.css" />
        <script type="text/javascript">
            $(document).ready(function() {
                    $('#rate2').rating('http://localhost/cairoguide/RatePlace.php?placeID=1', {maxvalue:5, curvalue:<?= $place->GetRate()?>, enabled: <?= Converter::ToBooleanString(Member::Logged()) ?> });
            });
        </script>
        <style type="text/css">
            .implementation{
                    border:dashed 2px #333333;
                    background-color:#CCCCCC;
                    color:#000000;
                    width:50%;
            }
            
            .spacer{
            clear:both;
            height:0px;
            }
            .left{
                    float:left;
                    width:250px;
            }
        </style>
        <link type="text/css" href="_theme/default.css" rel="stylesheet">
    </head>
    <body>
        
        <div class="placebasicdetails">
            <div class="leftcolumn">
                <img class="thumbnail" src="<?= AppConfig::$mediaUrl . $place->GetMainPhoto()->fileName ?>" />                                                  
                <div id="rate2" class="rating">&nbsp;</div>                
                <div class="sidenotbold"><?= $place->scoreNumberPeople ?> Votes</div>
                
                <a style='display:<?= HtmlHelper::Display(!Member::Logged()) ?>' href="Register.php?returnUrl=/ShowPlace.php?id=<?= $place->id ?>">Login or Register to Vote</a>
                
                <?= $place->address ?>                             
               
            </div>
            <div class="rightcolumn">
                <div class="placetitle"><?= $place->name ?></div>
                <div class="placedescription"><?= $place->description ?><div><br>                
            </div>
        </div>
        
        <div class="directionpanel">
            <div class="leftcolumn">
            dsfsdf
            </div>
            <div class="rightcolumn">
        dsfsdf
            </div>
        </div>
         
                
    </body>
</html>

<?
DbConnector::Disconnect();
?>